package com.micro.ai.gateway.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
import java.util.List;

/**
 * 限流配置
 * 支持Nacos配置动态刷新
 * 
 * @author micro-ai
 * @since 0.0.1
 */
@Configuration
@ConfigurationProperties(prefix = "rate-limit")
@RefreshScope
public class RateLimitConfig {

    private Integer defaultLimit = 100;
    private Integer defaultWindow = 60;
    private List<String> whitelistPaths;

    public Integer getDefaultLimit() {
        return defaultLimit;
    }

    public void setDefaultLimit(Integer defaultLimit) {
        this.defaultLimit = defaultLimit;
    }

    public Integer getDefaultWindow() {
        return defaultWindow;
    }

    public void setDefaultWindow(Integer defaultWindow) {
        this.defaultWindow = defaultWindow;
    }

    public List<String> getWhitelistPaths() {
        return whitelistPaths;
    }

    public void setWhitelistPaths(List<String> whitelistPaths) {
        this.whitelistPaths = whitelistPaths;
    }
}
